<template>
  <div class="container">
    <div class="movieitem" @click="handleClick(movie)">
      <div class="img">
        <img :src="movie.pic" alt="" />
      </div>
      <div class="describe">
        <span class="title"> {{ movie.title }} </span><br />
        <span> {{ movie.slogo }} </span><br />
        <span
          >观众评分
          <div class="raiting">{{ movie.raiting }}</div> </span
        ><br />
        <span>{{ movie.labels[0] }} </span>
        <span>{{ movie.labels[1] }} </span>
        <span>{{ movie.labels[2] }} </span>
      </div>
      <div class="sell">
        <div class="buy">购票</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    movie: {
      type: Object,
    },
  },
  methods: {
    handleClick(movie) {
      this.$router.push(`/detail?title=${movie.title}`)
    }
  },
};
</script>

<style scoped>
.container {
  padding: 0 auto;
}
.movieitem {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgb(203, 202, 202);
  cursor: pointer;
}
.img {
  width: 150px;
  height: 200px;
}
.img img {
  width: 100%;
  height: 100%;
}
.describe {
  width: 400px;
  height: 200px;
  margin-left: 15px;
  font-size: 15px;
}
.describe .title {
  font-size: 20px;
  color: black;
}
.describe .raiting {
  display: inline-block;
  color: orange;
}
.sell {
  margin-left: auto;
  padding: 108px 20px;
}
.sell .buy {
  width: 50px;
  height: 25px;
  text-align: center;
  line-height: 25px;
  border: 2px solid orangered;
  border-radius: 5px;
  color: orangered;
  font-size: 10px;
}
span {
  display: inline-block;
  margin: 15px 5px;
  color: #999;
}
</style>
